<template>
	<view>
		<view class="centerBox">
			<image src="../../static/images/renzheng.png" mode="" style="width: 130rpx; height:130rpx;"></image>
			<view class="approveText">
				<text>购买成功</text>
			</view>
			<view class="timeText">
				<text>将于</text>
				<view class="timeColor">
					<text>{{title.year}}年{{title.mon}}月{{title.day}}日</text>
				</view>
				<text>开始计算收益</text>
			</view>
			<view class="BuyBtnBox">
				<view class="GoOnbtn" @click="home">
					<text>再去逛逛</text>
				</view>
				<view class="GoOnbtn active" @click="myAssets">
					<text>查看个人中心</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: {
					year: '2021',
					mon: '03',
					day: '15'
				}, //当天日期
			}
		},
		onLoad(){
			this.GetTime()
		},
		methods: {
			//跳转首页
			home() {
				uni.switchTab({
					url: "../home/home"
				})
			},
			//跳转个人中心
			myAssets(){
				uni.switchTab({
					url: "../personal/personal"
				})
			},
			//获取日期
			GetTime() {
				var date = new Date();
				var base = Date.parse(date); // 转换为时间戳
				var year = date.getFullYear(); //获取当前年份
				var mon = date.getMonth() + 1; //获取当前月份
				var day = date.getDate()+1; //获取当前日
				var oneDay = 24 * 3600 * 1000
				this.title.year= `${year}`//年
				this.title.mon= `${mon >= 10 ? mon : '0' + mon}`//月
				this.title.day= `${day >= 10 ? day : '0' + day}`; //日
			},
		}
	}
</script>

<style>
	.centerBox {
		margin: 125rpx auto;
		text-align: center;
	}

	.approveText {
		font-size: 32rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: #333333;
		margin-top: 20rpx;
	}

	.timeText {
		display: flex;
		justify-content: center;
		font-size: 24rpx;
		font-family: PingFang SC;
		color: #666666;
		opacity: 1;
		margin-top: 20rpx;
	}

	.timeColor {
		color: #007AFF;
	}

	.BuyBtnBox {
		width: 680rpx;
		margin: 60rpx auto;
		height: 300rpx;
		display: flex;
		justify-content: space-around;
	}

	.GoOnbtn {
		width: 280rpx;
		height: 80rpx;
		line-height: 80rpx;
		text-align: center;
		color: #666666;
		font-size: 28rpx;
		border: 1px solid #CCCCCC;
		border-radius: 8rpx;
	}

	.active {
		color: #007AFF;
		border: 1px solid #007AFF;
	}
</style>
